package cn.lili.modules.promotion.entity.vos;

import cn.lili.modules.promotion.entity.dos.BlindboxPrizeRecord;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @Author xiangqian
 * @Date 2023/10/5 10:44
 */
@JsonInclude(JsonInclude.Include.ALWAYS)
@Data
@ApiModel(value = "盲盒开奖记录")
@ToString(callSuper = true)
@NoArgsConstructor
public class BlindboxPrizeRecordVO {

    /**
     * 昵称
     */
    @ApiModelProperty(name = "昵称", notes = "")
    private String userNick;

    /**
     * 头像
     */
    @ApiModelProperty(name = "头像", notes = "")
    private String face;

    /**
     * 开奖时间
     */
    @ApiModelProperty(name = "开奖时间", notes = "")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date prizeTime;
    /**
     * 开奖图片
     */
    @ApiModelProperty(name = "开奖图片", notes = "")
    private String images;

    /**
     * 中奖奖卷
     */
    @ApiModelProperty(name = "中奖奖卷", notes = "")
    private String paperCode;

    /**
     * 奖品名称
     */
    @ApiModelProperty(name = "奖品名称", notes = "")
    private String prizeName;

    /**
     * 奖品图片
     */
    @ApiModelProperty(name = "奖品图片", notes = "")
    private String prizeImage;

    /**
     * 商品名称
     */
    @ApiModelProperty(name = "商品名称", notes = "")
    private String goodsName;


    /**
     * dto转vo
     *
     * @param blindboxPrizeRecord DTO
     */
    public BlindboxPrizeRecordVO initBlindboxPrizeRecord(BlindboxPrizeRecord blindboxPrizeRecord) {
        BlindboxPrizeRecordVO blindboxPrizeRecordVO = new BlindboxPrizeRecordVO();
        BeanUtils.copyProperties(blindboxPrizeRecord, blindboxPrizeRecordVO);
        return blindboxPrizeRecordVO;
    }
}
